<?php if($model->checkAdmin || $model->countDiscussion) : ?>
	<div class="u_cat">
		<div class="u_cat_head_strip"></div>
		<div class="u_cat_head">
			<a href="<?php echo Yii::app()->createUrl('groupsDiscussion/index',array('group'=>$model->id));?>" class="ajaxLink">
				<em>Обсуждения</em><span><?php echo CHtml::encode($model->countDiscussion); ?></span>
			</a>
		</div>

		<?php if($model->countDiscussion) : ?>
		<div class="u_cont_list">
			<?php foreach ($model->discussions as $discussion) : ?>
			<div class="u_cont ajaxLinks">
				<a href="<?php echo Yii::app()->createUrl('groupsDiscussion/view',array('discussion'=>$discussion->id, 'group'=>$_GET['group']));?>" class="u_cont_pic">
					<img src="/images/btn/discussion.png" width="40" height="40" border="0" alt="" />
				</a>
				<div class="u_cont_r">
					<a href="<?php echo Yii::app()->createUrl('groupsDiscussion/view',array('discussion'=>$discussion->id, 'group'=>$_GET['group']));?>" class="u_cont_h2_discussion">
						<?php echo CHtml::encode($discussion->name); ?>
					</a>
					<p class="u_cont_black"><?php echo Yii::app()->dateFormatter->formatDateTime($discussion->update, 'long','short'); ?></p>
					<p class="u_cont_black"><?php echo CHtml::encode($discussion->countComments + 1); ?> коментарий</p>
				</div>
			</div>
			<?php endforeach; ?>
		</div>

		<?php else : ?>
		<div class="u_cont_list">
			<div class="u_cont">
				<div class="u_cont_r_empty">
					В сообществе ещё нет тем.
					<p><a href="<?php echo Yii::app()->createUrl('groupsDiscussion/create',array('group'=>$model->id));?>" class="u_cont_h2_discussion ajaxLink">
						Новая тема 
					</a></p>
				</div>
			</div>
		</div>
		<?php endif; ?>
	</div>
<?php endif; 